﻿/*----------------------------------------------------------------
    // Copyright (C) 2009 江苏华招网
    // 版权所有。 
    // 作者：庄金冬 
    //
    // 文件名：IBLL_Company.cs
    // 文件功能描述：企业接口
    // 创建标识：庄金冬2009-03-06
    //
    // 修改标识：
    // 修改描述：
    //
    // 修改标识：
    // 修改描述：
    //
    // 审核人：
    // 审核时间：
    // 审核说明：
 //----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Data;

using System.Text;
using HZ.DrugTrade.Model;

namespace HZ.DrugTrade.IBLL
{
    /// <summary>
    /// 企业接口
    /// </summary>
    public interface IBLL_Company
    {
        /// <summary>
        /// 获取所有企业
        /// </summary>
        /// <returns>所有企业</returns>
        IList<Company> GetAllCompany();


        /// <summary>
        /// 获取配送企业数量
        /// </summary>
        /// <returns>数量</returns>
        int GetAllCompanyCount();

        /// <summary>
        ///  获取生产企业最大编号    add by tzh
        /// </summary>
        /// <param name="ComInfo"></param>
        /// <returns></returns>
        string GetCompanySID();
        /// <summary>
        /// 获取经营企业最大编号    add by tzh
        /// </summary>
        /// <returns></returns>
        string GetCompanyJID();
        /// <summary>
        /// 获取配送企业最大编号    add by tzh
        /// </summary>
        /// <returns></returns>
        string GetCompanyPID();
        /// <summary>
        /// 获取所有未注册企业
        /// </summary>
        /// <returns>所有未注册企业</returns>
        IList<Company> GetAllUnregCompany();

        /// <summary>
        /// 获取所有未注册企业
        /// </summary>
        /// <param name="blSc">是否为生产:true，生产企业；false，其它</param>
        /// <returns>所有未注册企业</returns>
        IList<Company> GetAllUnregCompany(bool blSc);

        /// <summary>
        /// 编辑企业
        /// </summary>
        /// <param name="company">企业</param>
        /// <returns>True:成功;False:失败</returns>
        bool UpdateCompany(Company company);

        /// <summary>
        /// 编辑企业
        /// </summary>
        /// <param name="company">企业</param>
        /// <returns>True:成功;False:失败</returns>
        int UpdateCompany2(Company company);


        /// <summary>
        /// 删除企业
        /// </summary>
        /// <param name="company">企业</param>
        /// <returns>0.删除失败;1.删除成功;2.已被使用不能删除;</returns>
        int DeleteCompany(Company company);

        /// <summary>
        /// 添加企业
        /// </summary>
        /// <param name="company">企业</param>
        /// <returns>0.添加失败;1.添加成功;2.已经存在;</returns>
        int AddCompany(Company company);

        /// <summary>
        /// 条件企业查询
        /// </summary>
        /// <param name="company">查询用实体</param>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="totalRecord">（输出参数）总记录数目</param>
        /// <returns></returns>
        IList<HZ.DrugTrade.Model.Company> GetCompanyByWhere(HZ.DrugTrade.Model.Query.Company company, int currentPage, int pageSize, out int totalRecord);

        /// <summary>
        /// 条件企业查询
        /// </summary>
        /// <param name="company">查询用实体</param>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="totalRecord">（输出参数）总记录数目</param>
        /// <returns></returns>
        IList<Company> GetCompanyByCondition(HZ.DrugTrade.Model.Query.Company company, int currentPage, int pageSize, out int totalRecord);

        /// <summary>
        /// 条件企业查询
        /// </summary>
        /// <param name="company">查询用实体</param>
        /// <param name="currentPage">当前页</param>
        /// <param name="pageSize">每页显示记录数</param>
        /// <param name="totalRecord">（输出参数）总记录数目</param>
        /// <returns></returns>
        IList<Company> GetCompanyByCondition_PS(HZ.DrugTrade.Model.Query.Company company, int currentPage, int pageSize, out int totalRecord);

        /// <summary>
        /// 自助注册一个新企业信息(1成功 2已经存在该企业)
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <returns></returns>
        int RegNewCompany(Model.CompanyInfo companyinfo);
 

        /// <summary>
        /// 自助注册一个新企业信息 add by zdc
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <returns></returns>
        int RegNewCompany(Model.CompanyInfo companyinfo, string comType);

        /// <summary>
        /// 自助注册一个新企业信息(1成功 2已经存在该企业)
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <returns></returns>
        int RegNewCompany(Model.CompanyInfo companyinfo, Model.SelectArea selectArea);



        /// <summary>
        /// 编辑企业信息
        /// </summary>
        /// <param name="company"></param>
        /// <param name="companyinfo">企业信息</param>
        /// <param name="selectArea"></param>
        /// <returns>True:成功;False:失败</returns>
        int UpdateCompanyInfo(Company company, CompanyInfo companyinfo, Model.SelectArea selectArea);


        /// <summary>
        /// 将系统帐户与企业信息进行关联
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <param name="?"></param>
        /// <returns></returns>
        int MarkLinkToCompanyInfo(Model.CompanyInfo companyinfo, Model.Company company);

        /// <summary>
        /// 获取未注册的企业
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentpage"></param>
        /// <param name="pagesize"></param>
        /// <param name="totalrecord"></param>
        /// <returns></returns>
        IList<CompanyInfo> GetUnregedCompanyInfo(Model.Query.CompanyInfo where, int currentpage, int pagesize, out int totalrecord);

        /// <summary>
        /// 批量审核未注册企业
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        int AduitCompany(IList<CompanyInfo> list, out string outUserids);

        /// <summary>
        /// 删除不需要的企业列表
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        int DeleteCompanyInfo(IList<Model.CompanyInfo> list);

        /// <summary>
        /// 更新企业信息(企业名除外)
        /// </summary>
        /// <param name="companyinfo">企业名不能空</param>
        /// <returns></returns>
        int UpdateCompanyInfo(Model.CompanyInfo companyinfo);
        /// <summary>
        /// 根据企业ID获取企业其它信息
        /// </summary>
        /// <param name="companyid"></param>
        /// <returns></returns>
        CompanyInfo GetCompanyInfoByID(string companyid);
        /// <summary>
        /// 获取可配送某地区的配送企业
        /// 
        /// </summary>
        /// <param name="where"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        IList<Model.View.CompanyDistributableArea> GetDistributableCompany(Model.Query.CompanyDistributableArea where, int currentPage, int pageSize, out int totalRecord);

        /// <summary>
        /// 企业信息
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        DataTable GetCompanyInfoByWhere(string strWhere, int currentPage, int pageSize, out int totalRecord);
        /// <summary>
        /// 投标企业信息 add by zdc
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        DataTable GetCompanySCInfoByWhere(string strWhere, int currentPage, int pageSize, out int totalRecord);
        /// <summary>
        /// 获取要发放密码的企业列表 add by zdc
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        IList<Model.View.CompanySendPwd> GetCompanySendByWhere(string strWhere, int currentPage, int pageSize, out int totalRecord);
        /// <summary>
        /// 获取企业用户信息 add by zdc
        /// </summary>
        /// <param name="comId"></param>
        /// <returns></returns>
        Model.View.CompanySendPwd GetCom(string comId);
        /// <summary>
        /// 发放企业用户密码 add by zdc
        /// </summary>
        /// <param name="companySendPwd">企业用户</param>
        /// <param name="outCompanySendPwd">企业用户</param>
        /// <returns>0.失败；1成功</returns>
        int SendComAccountPWD(Model.View.CompanySendPwd companySendPwd, out Model.View.CompanySendPwd outCompanySendPwd);

        DataTable GetCompanyInfoByWhereForMerge(string strWhere, int currentPage, int pageSize, out int totalRecord);
        /// <summary>
        /// 企业信息
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        DataTable GetCompanyInfoByWhere2(string strWhere, int currentPage, int pageSize, out int totalRecord);
        /// <summary>
        /// 企业信息:含可配送区域 修改 by zdc
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        DataTable GetCompanyInfoByWhereZDC(string strWhere, int currentPage, int pageSize, out int totalRecord);
        DataTable GetCompanyInfoByWhere(HZ.DrugTrade.Model.Query.Company company, int currentPage, int pageSize, out int totalRecord);


        /// <summary>
        /// 企业信息:含可配送区域
        /// </summary>
        /// <returns></returns>
        DataTable GetCompanyInfoByWhere3(string strWhere, int currentPage, int pageSize, out int totalRecord);


        /// <summary>
        /// 合并企业信息
        /// </summary>
        /// <returns></returns>
        int MergeCompanyInfo(string standardID, string mergeID);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="lst"></param>
        /// <returns></returns>
        int UpdateCompanySNKEY(IList<Model.Company> lst, string UID);

        /// <summary>
        /// 获取符合条件的企业
        /// </summary>
        /// <returns></returns>

        IList<Company> GetCompanyByWhere(string strWhere);
        /// <summary>
        /// 中心审核配送企业的配送区域 zdc
        /// </summary>
        /// <param name="ps"></param>
        /// <param name="checkUser">审核人</param>
        /// <param name="areaIDs">审核区域</param>
        /// <param name="checkType">0:审核未通过，否则通过</param>
        /// <returns></returns>
        bool CheckAreaByZbzx(PSSelectArea ps, string checkUser, string areaIDs, int checkType);
        /// <summary>
        /// 审核配送企业的详细信息 zdc
        /// </summary>
        /// <param name="ps"></param>
        /// <param name="checkType"></param>
        /// <param name="checkUser"></param>
        /// <returns></returns>
        bool CheckCompanyInfo(PSSelectArea ps, int checkType, string checkUser,string state);
        /// <summary>
        /// 审核配送企业和配送区域的权利 zdc
        /// </summary>
        /// <param name="ps"></param>
        /// <param name="checkType"></param>
        /// <param name="checkUser"></param>
        /// <returns></returns>
        bool CheckEnterpriseInfo(PSSelectArea ps, int checkType, string checkUser);
        /// <summary>
        /// 获取配送企业选择已提交的配送区域 zdc 
        /// </summary>
        /// <param name="comPS_Id"></param>
        /// <returns></returns>
        DataTable GetAreasById(string comPS_Id);
        /// <summary>
        /// 获取配送企业选择的配送区域 zdc 
        /// </summary>
        /// <param name="comPS_Id"></param>
        /// <returns></returns>
        string GetAreasByComId(string comPS_Id);
        /// <summary>
        /// 获取配送企业的类型 zdc
        /// </summary>
        /// <param name="comPS_Id"></param>
        /// <returns></returns>
        string GetCompanyType(string comPS_Id);
        /// <summary>
        /// 配送企业查看审核原因 zdc
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="areaId"></param>
        /// <returns></returns>
        string GetReason(string userId, string areaId);

        /// <summary>
        /// 获取企业类型 add zdc
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        string GetComType(string userId);

        /// <summary>
        /// 获取所有国内生产企业和配送企业信息由生产企业勾选用
        /// </summary>
        /// <returns></returns>
        DataTable GetCompanyInfo();
        /// <summary>
        /// 判断是否是生产企业 add by zdc
        /// </summary>
        /// <param name="companyID"></param>
        /// <returns></returns>
        bool IsSCCompany(string companyID);
        /// <summary>
        /// 返回公司的文件过期情况
        /// </summary>
        /// <param name="companyid">公司ID</param>
        /// <param name="type">公司类型</param>
        /// <returns></returns>
        DataTable GetCmpTimeinfo(string companyid, string compnayname);

        /// <summary>
        /// 分页先是企业信息 add by gaoyang
        /// </summary>
        /// <param name="companyid">企业流水号</param>
        /// <param name="companyname">企业名称</param>
        /// <param name="currentPage">当前是第几页</param>
        /// <param name="pageSize">每页显示的条目数</param>
        /// <param name="totalRecord">一共分多少页</param>
        /// <returns></returns>
        IList<Model.View.VCompanyInfo> GetCmpTimeinfoByWhere(string companyid, string companyname, int currentPage, int pageSize, out int totalRecord);

        /// <summary>
        /// 根据企业类型得到一共有多少条数据
        /// </summary>
        /// <param name="roleId">tb_role_user表的roleId用来判断用户类型</param>
        //int GetCompanyCount(string roleId);
         /// <summary>
        /// 盟市查询企业信息
        /// add by Meng 2013-03-12
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        DataTable GetUnionCityCompanyInfoByWhere(string strWhere, int currentPage, int pageSize, out int totalRecord);
         /// 中心查询盟市审核配送企业信息
        /// add by Meng 2013-03-12
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalRecord"></param>
        /// <returns></returns>
        DataTable GetUnionCityCompanyInfoBySelect(string strWhere, int currentPage, int pageSize, out int totalRecord);
        /// <summary>
        /// 更新企业信息
        /// add by Meng 2013-03-20
        /// </summary>
        /// <param name="companyinfo"></param>
        /// <returns></returns>
        int UpdateCompanyInfoByCompanyId(HZ.DrugTrade.Model.CompanyInfo companyinfo);
    }
}

